{% extends "../../base.html"%} {% block header_title %}后台管理首页{% end %}{% block body %}
<div class="row">
    <div class="col-xs-1 col-sm-1 col-md-1 sidebar">
        <div class="user">
            <img src="{{static_url('images/ico-user-header.svg')}}">
            <h5>{{current_user['username']}}</h5>
            <a href="/auth/signout"><span class="glyphicon glyphicon-cog"title="用户中心"></span></a>&nbsp;
            <a href="/auth/signout">
                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
            </a>
        </div>
        <ul class="nav nav-sidebar">
            <li title="首页">
                <a href="/admin">
                    <i class="fa fa-home"></i>
                    <span class="hidden-sm hidden-xs text">首页</span>
                </a>
            </li>
            <li title="数据集" class="active">
                <a href="/admin/data">
                    <i class="fa fa-archive"></i>
                    <span class="hidden-sm hidden-xs text">数据集</span>
                </a>
            </li>
            <li title="申请单">
                <a href="/admin/apply">
                    <i class="fa fa-archive"></i>
                    <span class="hidden-sm hidden-xs text">申请单</span>
                </a>
            </li>
            <li title="应用表">
                <a href="/admin/app">
                    <i class="fa fa-archive"></i>
                    <span class="hidden-sm hidden-xs text">应用表</span>
                </a>
            </li>
        </ul>
    </div>
    <div class="col-xs-11 col-xs-offset-1 col-sm-11 col-sm-offset-1 col-md-11 col-md-offset-1 main">
        <div class="page-header">
            <h1>数据集添加</h1><small>这里列举的是数据集的细节属性<br>1，数据集的说明<br>2，数据集的元数据</small>
        </div>
        <section>
            <div class="box">
                <a href="/admin/data/{{detail.get('_id')}}" class="btn btn-default">
                    <i class="fa fa-angle-double-left"></i> 返回数据集细节</a>
            </div>
            <div class="box">
                <div class="box-body">
                    <div class="table-responsive">
                        <table class="table table-bordered table-striped">
                            <colgroup>
                                <col class="col-xs-2">
                                <col class="col-xs-2">
                                <col class="col-xs-7">
                            </colgroup>
                            <thead>
                                <tr>
                                    <th>字段名</th>
                                    <th>数据类型</th>
                                    <th>字段说明</th>
                                    <th></th>
                                </tr>
                            </thead>
                            {%set args = detail.get('args')%}
                            <tbody>
                                {% for arg in args%}
                                <tr>
                                    <th scope="row">
                                        <code>{{arg.get('title')}}</code>
                                    </th>
                                    <td>{{arg.get('atype')}}</td>
                                    <td>{{arg.get('note')}}</td>
                                    <td><a href="javascript://" data-oid="{{arg.get('_id')}}">修改</a></td>
                                </tr>
                                {%end%}
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="box-title">
                    <h5>添加元数据</h5>
                </div>
                <div class="box-body">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <colgroup>
                                <col class="col-xs-1">
                                <col class="col-xs-7">
                            </colgroup>
                            <form action="/admin/data_meta/create" method="post">
                                <tbody>
                                    <tr>
                                        <th scope="row">
                                            <code>字段名</code>
                                        </th>
                                        <td>
                                            <input type="text" name="argTitle" class="form-control">
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            <code>数据类型</code>
                                        </th>
                                        <td>
                                            <input type="text" name="argType" class="form-control">
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            <code>字段说明</code>
                                        </th>
                                        <td>
                                            <textarea name="argNote" class="form-control" rows="8" cols="40">
                                            </textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                        </th>
                                        <td>
                                            <button type="submit" class="btn btn-primary">添加</a>
                                                <input type="hidden" name="oid" value="{{detail.get('_id')}}" /> {% raw xsrf_form_html() %}
                                        </td>
                                    </tr>
                                </tbody>

                            </form>
                        </table>
                    </div>

                </div>
            </div>
        </section>
    </div>
</div>
{% end %}
